80103: Function test for xfi:unit-numerator

Documentation

Tests of function xfi:unit-numerator($unit as element(xbrli:unit)) as element(xbrli:measure)+

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 23-01-2008 at 00:00:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670669

Test Case Variations


V-01 Returns correct measure for unit-squareMiles

Documentation

Tests that element returned is unit for specified item.

Inputs

Outputs

  • Result test: $result instance of element(xbrli:measure)+ and count( $result ) eq 1 and $result is //xbrli:unit[@id eq 'unit-squareMiles']/xbrli:measure

V-02 Returns correct measures for multi-measure unit

Documentation

Tests that elements returned are measures for specified item.

Inputs

Outputs

  • Result test: $result instance of element(xbrli:measure)+ and count( $result intersect ( //xbrli:unit[@id eq 'unit-power']/xbrli:measure[1], //xbrli:unit[@id eq 'unit-power']/xbrli:measure[2] ) ) eq 2

V-03 Returns measure for divide based unit

Documentation

Inputs

Outputs

  • Result test: $result instance of element(xbrli:measure)+ and count( $result ) eq 3 and count( $result[local-name() eq 'measure' and local-name-from-QName(.) eq 'meters'] ) eq 2 and count( $result[local-name() eq 'measure' and local-name-from-QName(.) eq 'kilogram'] ) eq 1

V-04 Returns measure for inverse unit (1/secs)

Documentation

Inputs

Outputs

  • Result test: $result instance of element(xbrli:measure)+ and count( $result ) eq 1 and $result eq QName('http://www.xbrl.org/2003/instance', 'xbrli:pure')

V-05 Wrong node to function

Documentation

XPath-defined error for node type incorrect.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

V-06 A sequence of items as argument, wrong arity for argument type definition

Documentation

XPath-defined error for node type incorrect arity of arguments.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

V-07 Wrong number of arguments

Documentation

XPath-defined error for incorret number of arguments.

Inputs

  • schema: unit-test-concepts.xsd
  • instance: unit-test-instance.xml (DTS Discovery starting point) (ID=V07)
  • Function Call: xfi:unit-numerator( //xbrli:unit[@id eq 'unit-speedMPH'], //xbrli:unit[@id eq 'unit-speedKMH'] )

    (against file V07)

Outputs

  • Error code: xqt-err:XPST0017

Revisions

Name On Details
Herm Fischer 23-01-2008 at 00:00:00 Created the test case.
Herm Fischer 05-02-2008 at 00:00:00 Added variation for a tuple.